<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('查看采购单')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-purchase-edit" th:object="${chainPurchase}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">合作公司：</label>
            <div class="col-sm-8">
                <input class="form-control" disabled type="text"
                       id="cooperationName"
                       readonly="true" th:value="*{cooperationName}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">商品名称：</label>
            <div class="col-sm-8">
                <input class="form-control" disabled type="text"
                       id="commodityName"
                       readonly="true" th:value="*{commodityName}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">采购人：</label>
            <div class="col-sm-8">
                <div class="input-group">
                    <input class="form-control" type="text" id="userName"
                           readonly="true" th:value="*{userName}" required>
                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品图片：</label>
            <div class="col-sm-8">
                <img th:src="*{image}" width="150" height="100">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">数量：</label>
            <div class="col-sm-8">
                <input name="quantity" disabled th:field="*{quantity}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">金额：</label>
            <div class="col-sm-8">
                <input name="amount" disabled th:field="*{amount}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">运输方式：</label>
            <div class="col-sm-8">
                <select name="transportType" disabled class="form-control m-b"
                        th:with="type=${@dict.getType('transport_type')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{transportType}"></option>
                </select>
            </div>
        </div>

<!--        质检信息展示-->
        <div class="hr-line-dashed"></div>
        <div class="form-group">
            <label class="col-sm-3 control-label">质检结果</label>
            <div class="col-sm-8">
                <input th:if="${chainPurchase.inspectionStatus == 'QUALIFIED'}" value="合格" class="form-control" readonly>
                <input th:if="${chainPurchase.inspectionStatus == 'UNQUALIFIED'}" value="不合格" class="form-control" readonly>
                <input th:if="${chainPurchase.inspectionStatus == 'PENDING'}" value="待质检" class="form-control" readonly>
            </div>
        </div>
        <!--<div class="form-group" th:if="${com.ruoyi.chain.purchase.domain.ChainPurchase.}">
            <label class="col-sm-3 control-label">质检备注</label>
            <div class="col-sm-8">
                <textarea th:value="${chainPurchase.qualityRemark}" class="form-control" readonly></textarea>
            </div>
        </div>-->

        <div class="hr-line-dashed"></div>
        <div class="form-group">
            <label class="col-sm-2 control-label">货运状态</label>
            <div class="col-sm-10">
                <select disabled name="transportStatus" class="form-control m-b"
                        th:with="type=${@dict.getType('transport_status')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{transportStatus}"></option>
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "chain/purchase";
    var cooperationPrefix = ctx + "chain/cooperation"
    var commodityPrefix = ctx + "chain/commodity";
    $("#form-purchase-edit").validate({
        focusCleanup: true
    });


    function submitHandler() {
        $.modal.close();
    }

</script>
</body>
</html>